package com.yt.server.example;

import com.yt.server.api.IConnection;
import com.yt.server.api.IScope;
import com.yt.server.api.action.IActionResolver;
import com.yt.server.common.command.BaseCommand;

@SuppressWarnings("rawtypes")
public class WalkAction extends BaseCommand<IWalkService> implements
		IActionResolver {

	public WalkAction() {
		this.commandName = "WalkCommand";
		facade.registerCommand(this);
		System.out.println("WalkAction inited.");
	}

	public void synXY(IConnection conn, People people) {
		service.synXY(conn, people);
	}

	public void addPlay(IConnection conn, People people) {
		service.addPlay(conn, people);
	}

	@Override
	public Object resolveService(IScope scope, String actioneName) {
		if (this.commandName.equals(actioneName))
			return this;
		return null;
	}

	@Override
	public void setService(IWalkService service) {
		this.service = service;
	}
}
